import React from 'react';
// 导入路由
import {
    BrowserRouter as Router,
    Route,
    Switch,
} from 'react-router-dom'
// 导入页面组件
import Login from './pages/Login'
import Layouts from './pages/Layout'
import AuthRoute from './components/AuthRouter'
import history from './utils/history'
export default class App extends React.Component {
    render() {
        return (
            <Router history={history}>
                <div className="App">
                    {/* 路由规则 */}
                    <Switch>
                        <Route path="/login" component={Login}></Route>
                        <AuthRoute path="/" component={Layouts}></AuthRoute>
                    </Switch>
                </div>
            </Router>
        )
    }
}